// C++ author 清晨与猫鱼
#include <iostream>
#include <string>
#include "Realize.h"

using namespace std;

int main(const int argc, const char** argv)
{	
    // 创建两个翻译表达式
    Expression* robert = new TerminalExpression("Robert");
    Expression* john = new TerminalExpression("John");

    // 进行或解析
	OrExpression isMale(robert, john);

    //  创建两个翻译表达式
    Expression* julie = new TerminalExpression("Julie");
    Expression* married = new TerminalExpression("Married");

    // 进行与翻译
    AndExpression isMarriedWoman(julie, married);

    // 输出翻译结果
    cout <<  isMale.interpret("John") << endl;

    // 输出翻译结果
    cout << isMarriedWoman.interpret("Married Julie") << endl;
}